/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.ove.utils;

/**
 *
 * @author Mr.Sam
 */
import javax.swing.JFileChooser;
import java.awt.Component;
import java.io.File;

/**
* A file chooser.
*/
public class FileChooser extends JFileChooser {
    /**
    *
    */
    private Component compReference = null;
    
    /**
    * The Constructor.
    */
    public FileChooser() {
        this(null);
    }
    
    /**
    * The Constructor.
    */
    public FileChooser(Component compReference) {
        super();
        this.compReference = compReference;
    }
    
    /**
    * Pops the instance for opening a file.
    */
    public int showOpen() {
        return showOpenDialog(compReference);
    }
    
    /**
    * Pops the instance for saving a file.
    */
    public int showSave() {
        return showSaveDialog(compReference);
    }
    
    /**
    *
    */
    public void setCompReference(Component compReference) {
        this.compReference = compReference;
    }
    
    /**
    * 
    */
    public Component getCompReference() {
        return compReference;
    }
}